// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   DensityUtil.java

package test.sgone.cn.mulimagedemo;

  
import android.util.Log;

public class DensityUtil
{
    public static int dip2px(float f)
    {
        return (int)(0.5F + f * AppContext.getInstance().getResources().getDisplayMetrics().density);
    }

    public static int getScale()
    {
        return (int)AppContext.getInstance().getResources().getDisplayMetrics().density;
    }

    public static int getScreenHeight()
    {
        return AppContext.getInstance().getResources().getDisplayMetrics().heightPixels;
    }

    public static int getScreenHeightDip()
    {
        return px2dip(AppContext.getInstance().getResources().getDisplayMetrics().heightPixels);
    }

    public static int getScreenWidth()
    {
        return AppContext.getInstance().getResources().getDisplayMetrics().widthPixels;
    }

    public static int getScreenWidthDip()
    {
        return px2dip(AppContext.getInstance().getResources().getDisplayMetrics().widthPixels);
    }

    public static String getX_Screen()
    {
        int i = dip2px(getScreenHeightDip());
        int j = getScreenWidth();
        String s = String.valueOf(i);
        String s1 = String.valueOf(j);
        if(isEnableXScreen)
            X_Screen = (new StringBuilder(String.valueOf(s))).append("x").append(s1).toString();
        else
            X_Screen = "320x480";
        Log.d("X_Screen", X_Screen);
        return X_Screen;
    }

    public static int px2dip(float f)
    {
        return (int)(0.5F + f / AppContext.getInstance().getResources().getDisplayMetrics().density);
    }

    public static String X_Screen;
    public static boolean isEnableXScreen = false;

}
